package com.controller.jkt;

import com.service.jkt.ChaXunService;
import com.service.jkt.QiTaService;
import com.service.jkt.YeWuServise;
import com.util.gzp.AjaxResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

@RestController
@Api(tags = "查询的接口(用于审批和审核的数据显示)")
@RequestMapping("/cha")
@Validated
public class ChaXunController {
    @Resource
    private ChaXunService chaXunService;
    @Resource
    private QiTaService qiTaService;

    @GetMapping("/syq")
    @ApiOperation(value = "查询 所有权 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findsyq(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findsyq(serviceid);
    }

    @GetMapping("/xf")
    @ApiOperation(value = "查询 他项权:现房 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findxf(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findxf(serviceid);
    }

    @GetMapping("/zj")
    @ApiOperation(value = "查询 他项权:在建 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findzj(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findzj(serviceid);
    }
    @GetMapping("/cf")
    @ApiOperation(value = "查询 查封登记 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findcf(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findcf(serviceid);
    }
    @GetMapping("/jf")
    @ApiOperation(value = "查询 解封登记 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findzx(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findjf(serviceid);
    }
    @GetMapping("/yy")
    @ApiOperation(value = "查询 异议 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findyy(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findyy(serviceid);
    }
    @GetMapping("/yg")
    @ApiOperation(value = "查询 预告(预售) 的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findyg(
            @ApiParam("业务id") Integer serviceid
    ) {
        return chaXunService.findyg(serviceid);
    }




    @GetMapping("/fang")
    @ApiOperation(value = "通过 门牌号 查询房屋信息的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findroom(
            @ApiParam("门牌号") String roomnumber
    ) {
        return qiTaService.findByRoomnumber(roomnumber);
    }

    @GetMapping("/ren")
    @ApiOperation(value = "通过 客户id 查询客户信息的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findclient(
            @ApiParam("客户id") Integer clientid
    ) {

        return qiTaService.findClient(clientid);
    }
    @GetMapping("/renming")
    @ApiOperation(value = "通过 客户id 查询客户信息的方法，返回AjaxResponse", response = Map.class)
    public AjaxResponse findclientname(
            @ApiParam("客户名") String ren
    ) {

        return qiTaService.findClientname(ren);
    }

}
